/**
 * 用于封装toast
 */
const toast = Swal.mixin({
    toast: true,
    position: "top-end",
    showConfirmButton: false,
    timer: 3000,
    timerProgressBar: true,
    didOpen: (toast) => {
        toast.onmouseenter = Swal.stopTimer;
        toast.onmouseleave = Swal.resumeTimer;
    }
});

// ---------------------------- 以上代码来自sweetalert2 的toast 组件代码 -----------------------------

Toast = {
    success: function (message) {
        toast.fire({
            icon: "success",
            title: message
        });
    },
    error: function (message) {
        toast.fire({
            icon: "error",
            title: message
        });
    },
    warning: function (message) {
        toast.fire({
            icon: "warning",
            title: message
        });
    },
}